﻿using System.Windows;
using Microsoft.Win32;

namespace RiskMan.Views.Robot
{
    /// <summary>
    /// Interaction logic for SoundPanel.xaml
    /// </summary>
    public partial class SoundPanel : Window
    {
        public SoundPanel()
        {
            InitializeComponent();
        }

        private void Button_Cancel_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog tmp = new OpenFileDialog();
            tmp.Filter = "wav files (*.wav)|*.wav";
            if (tmp.ShowDialog() == true)
            {
                txbxOpenPoz.Text = tmp.FileName;
            }
        }

        //private void button2_Click(object sender, RoutedEventArgs e)
        //{
        //    OpenFileDialog tmp = new OpenFileDialog();
        //    tmp.Filter = "wav files (*.wav)|*.wav";
        //    if (tmp.ShowDialog() == true)
        //    {
        //        txbxClosePoz.Text = tmp.FileName;
        //    }
        //}

        private void Button_Accept_Click(object sender, RoutedEventArgs e)
        {
            Properties.Settings.Default.SoundOpenPoz = txbxOpenPoz.Text;
            //Properties.Settings.Default.SoundClosePoz = txbxClosePoz.Text;

            Properties.Settings.Default.Save();
            Close();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            txbxOpenPoz.Text = Properties.Settings.Default.SoundOpenPoz;
            //txbxClosePoz.Text = Properties.Settings.Default.SoundClosePoz;
        }
    }
}
